<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>数据库优化修复-数据管理-{$site.SITE_INFO.name}</title>
        <php>
            $addCss="";
            $addJs="";
            $currentNav='数据管理 > 数据库优化修复';
        </php>
        <include file="Common:intoHead" />
    </head>
    <body>
        <div class="wrap">
            <include file="Common:head" />
            <div class="mainBody">
                <include file="Common:left" />
                <div id="Right">
                    <div class="Item hr">
                        <span class="fr">数据库中共有{$list|count}张表，共计{$totalsize.table|byteFormat}</span>
                        <div class="current">数据库优化修复</div>
                    </div>
                    <form>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
                            <thead>
                                <tr>
                                    <td width="90"><label><input name="" class="chooseAll" type="checkbox"/> 全选</label> <label><input name="" class="unsetAll" type="checkbox"/> 反选</label></td>
                                    <td>表名</td>
                                    <td>表用途</td>
                                    <td>记录行数</td>
                                    <td>引擎类型</td>
                                    <td>字符集</td>
                                    <td>碎片</td>
                                    <td>表大小</td>
                                    <td>数据</td>
                                    <td>索引</td>
                                </tr>
                            </thead>
                            <tbody>
                                <volist name="list" id="tab">
                                    <tr align="center">
                                        <td><input type="checkbox" name="table[]" value="{$tab.Name}"/></td>
                                        <td align="left">{$tab.Name}</td>
                                        <td>{$tab.Comment}</td>
                                        <td>{$tab.Rows}</td>
                                        <td>{$tab.Engine}</td>
                                        <td>{$tab.Collation}</td>
                                        <td>{$tab.Data_free}</td>
                                        <td>{$tab.size}</td>
                                        <td>{$tab.Data_length}</td>
                                        <td>{$tab.Index_length}</td>
                                    </tr>
                                </volist>
                            </tbody>
                            <tfoot align="center">
                                <tr>
                                    <td width="90"><label><input name="" class="chooseAll" type="checkbox"/> 全选</label> <label><input name="" class="unsetAll" type="checkbox"/> 反选</label></td>
                                    <td>表名</td>
                                    <td>表用途</td>
                                    <td>记录行数</td>
                                    <td>引擎类型</td>
                                    <td>字符集</td>
                                    <td><b>{$totalsize.free|byteFormat}</b></td>
                                    <td><b>{$totalsize.table|byteFormat}</b></td>
                                    <td><b>{$totalsize.data|byteFormat}</b></td>
                                    <td><b>{$totalsize.index|byteFormat}</b></td>
                                </tr>
                            </tfoot>
                        </table>
                        <input type="hidden" name="act" id="act" />
                    </form>
                    <div class="commonBtnArea" >
                        <button class="btn optimize">优化所选</button>
                        <button class="btn repair">修复所选</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <include file="Common:foot" />
        <script type="text/javascript">
            $(function(){
                clickCheckbox();
                var handle=function(act){
                    if($("tbody input[type='checkbox']:checked").size()==0){
                        popup.alert("请先选择你要优化的数据库表吧");
                        return false;
                    }
                    $("#act").val(act);
                    commonAjaxSubmit();
                }
                $(".optimize").click(function(){ handle("optimize"); });
                $(".repair").click(function(){  handle("repair"); });
            });
        </script>
    </body>
</html>
